home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
L' Effet Pommier 3
/
L'Effet Pommier - Volume 03.iso
/
Communication
/
CommFigure
/
Module Creation
< prev
next >
Wrap
Text File
|
1996-01-07
|
5KB
|
137 lines
CommFigure Module Notation and Creation.
A CommFigure Module is a based around a STR# type resource with an ID of 128.
The module must have the creator signature of VOND and a file type of MODL, for
CommFigure to pick them up. They are currently found anywhere on the startup hard disk.
Future versions of CommFigure will restrict them to being only in the modules
folder.
The first 6 fields of the STR# resource is header information.
Field Number #1
Description The module name as seen from within CommFigure
Example Netscape
Notes -
Field Number #2
Description The pathname to the preference file that CommFigure will be
editing.
Example :System Folder:Preferences:Netscape ─:Netscape Preferences
Notes Due to my lack of programming skills at this time, I have had
to assume you will using the Startup Hard Disk, that is
why the Hard Disk name is missing from my example pathname.
Field Number #3
Description The resource type where the preferences are stored
Example STR# or PREF
Notes Should be left blank if its a Data Fork type preference
file.
Field Number #4
Description The handler procedure CommFigure will use when editing the
preference file.
Example 1 or 2 or 3
Notes 1 - STR# Type Preferences when all the preferences are
stored in one long STR# resources, similar to what Eudora
and Netscape use.
2 - DATA Fork Preferences, similar to MacPPP
3 - Other Resource Types, (ie PREF) - used by Homer etc
Field Number #5
Description The Resource ID of a STR# resource
Example 128
Notes Leave empty for Data Fork or other Resource Type
preferences
Field Number #6
Description How many settings will be changed
Example 3
Notes How many settings the module will modify in the target
preference file. For example if you changed Email,
Realname, and IRC Server that would be 3 settings (ie. 3)
The remaining fields are for specific settings data. Each setting requires for
fields so you will note that fields are grouped in fours. The first setting
fields will be #7 through to #10 inclusive
Field Number #7
Description STR# Field ID, DATA Fork Offset, Other Resource Type Offset
Example 176 (convert Hex offsets into decimal please!)(DFType)
77 (STR# Type)
0 (other resource type - this will start writing to
resource as character one)
Notes -
Field Number #8
Description The Setting Type to be modified
Example 4 (this would be the organisation settings)
Notes 1 Real name
2 Email address
3 Password
4 Organisation
5 Download Folder
6 Homepage (default page)
7 SMTP Server
8 NNTP Server
9 Archie Server
10 Info-Mac Mirror Server
11 IRC Server
12 Ph Server
13 Finger Server
14 IRC Nickname
15 Proxy Server
16 Proxy Server Port
17 Login Account
18 University of Michigan Macintosh Mirrors
19 Download Folder Volume
20 Download Folder Half Pathname
The Half Pathname returns something like :System
Folder:Preferences:Netscape ─ - this could be used in
programs that require a download folder volume in one
setting and the rest of the pathname in another.
Field Number #9
Description The maximum length of the data to be written
Example 20 (this means 20 characters is the max)
Notes
Now this really caused me problems this part... this is
probably the most important field... Anyway, this field control two things. The
first is if the length of an edit text field is longer than this number the
string is truncated when the preference file is edited. However if you put the
number 0 in this field, there is no maximum length. However CommFigure will put
null characters after the string has finished until it reaches the first null
character it finds. This is so CommFigure kills any old remaining text that was
left behind. The next thing is, a lot of programs use the first character of a
string to measure the length, (so the first real character of the string will
be the second character from the offset). If the program you are writing a
module for does this, you must put a maximum length into this field, it it
doesn't put in zero. You should definitely make some copies of preferences
files when testing your module.
Field Number #10
Description The Settings Resource ID
Example 129
Notes Different settings may have different resource ID (have a
look at the Fetch Preferences as you'll get the idea).
For each setting put the resource into this field. If
more than one setting is in the resource with the same ID,
just continue repeating the process for each successive
settings entry.
NOTE WELL : OK - you probably couldn't understand that - just look at the
modules that have been included and their related preference files and you'll
get the idea. Make sure you back up the original preference files when testing
your modules out.
Other Stuff
Please send me messages as to what other fields you would like to see, ie
Default Fonts, WHOIS servers etc... I need to know which ones are popular and
which ones aren't.
Comments, suggestions, complaints, and proclaimations to kura@ins.co.nz
CommFigure. ⌐1996 Jonathan Dean